<template>
  <div class="my-invoice-detail">  
    <row title="金额"  :value="'￥'+detail.price"></row>
    <row title="申请日期"  :value="detail.addTime"></row>
    <row title="状态"  :value="detail.statusText"></row>
    <row title="状态"  :value="detail.statusText"></row>
    <row title="银行"  :value="detail.bank"></row>
    <row title="公司"  :value="detail.company"></row>
    <row title="公司地址"  :value="detail.companyAddress"></row>
    <!-- <row title="发票号"  :value="detail.number"></row> -->
    <!-- <div class="invoice-photo">
        <div class="map-title">发票照片</div>
        <div class="">
            <img :src="detail.poster"  class="invoice-photo-img">
        </div>
    </div> -->
    <div class="invoice-photo">
      <div class="map-title">发票订单<span class="tips">(订单号/金额/时间)</span></div>
      <div :class="['invoice-order' , index%2==0?'invoice-active':'']" v-for="(item,index) in detail.invoiceOrderList" :key="index">
          <div class="invoice-number">{{item.orderSn}}</div>
          <div class="invoice-money">￥{{item.price}}</div>
          <div class="invoice-timer">{{item.orderTime}}</div>
      </div>
    </div> 
  </div>
</template>

<script>
import row from '@/components/row'
import api from '@/api/api.js' 
export default { 
  components: {
    row
  },
  data () {
    return {
      detail:{
          money:'125.00',
          time:'2020-12-28 12:28',
          statusName:'待开票',
          number:'kl1354131545',
          poster:'',
          invoiceOrderList:[]
      }
    }
  },
  mounted () {
    this.getDetail()
  },
  filters: {
     
  },
  methods: {
    getDetail(){
      api.invoiceMng.invoiceDetail({
        invoiceId: this.$route.query.id
      },res=>{
        this.detail=res.result
      })
    }
  }
}
</script>
<style lang="less" scoped>
.invoice-photo{
    padding: 12px 16px;
}
.map-title{
    height: 40px;
    line-height: 40px;
    font-size: 16px;
    font-weight: bold;
}
.invoice-photo-img{
   width: 100%;
   min-height: 50px;
   background: #ccc;
}
.invoice-order{
    display: flex;
    height: 40px;
    line-height: 40px;

}
.invoice-number{
    color: #444;
    width: 45%;
    padding-left: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tips{
    color: #999;
    font-size: 11px;
    margin-left: 8px;
}
.invoice-money{
    color: #999;
    width: 20%;
}
.invoice-timer{
   color: #666; 
   width: 35%;
   overflow: hidden;
}
.invoice-active{
    background: #e1e1e1;
}
</style>
